<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" [formGroup]="editForm">
            <h2 id="jhi-job-history-heading">Create or edit a Job History</h2>

            <div>
                <jhi-alert-error></jhi-alert-error>

                <div class="form-group" [hidden]="!editForm.get('id')!.value">
                    <label for="id">ID</label>
                    <input type="text" class="form-control" id="id" name="id" formControlName="id" readonly />
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_startDate">Start Date</label>
                    <div class="d-flex">
                        <input id="field_startDate" type="datetime-local" class="form-control" name="startDate" formControlName="startDate" placeholder="YYYY-MM-DD HH:mm"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_endDate">End Date</label>
                    <div class="d-flex">
                        <input id="field_endDate" type="datetime-local" class="form-control" name="endDate" formControlName="endDate" placeholder="YYYY-MM-DD HH:mm"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_language">Language</label>
                    <select class="form-control" name="language" formControlName="language" id="field_language">
                        <option value="FRENCH">FRENCH</option>
                        <option value="ENGLISH">ENGLISH</option>
                        <option value="SPANISH">SPANISH</option>
                    </select>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_job">Job</label>
                    <select class="form-control" id="field_job" name="job" formControlName="jobId">
                        <option [ngValue]="null"></option>
                        <option [ngValue]="jobOption.id" *ngFor="let jobOption of jobs; trackBy: trackById">{{ jobOption.id }}</option>
                    </select>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_department">Department</label>
                    <select class="form-control" id="field_department" name="department" formControlName="departmentId">
                        <option [ngValue]="null"></option>
                        <option [ngValue]="departmentOption.id" *ngFor="let departmentOption of departments; trackBy: trackById">{{ departmentOption.id }}</option>
                    </select>
                </div>

                <div class="form-group">
                    <label class="form-control-label" for="field_employee">Employee</label>
                    <select class="form-control" id="field_employee" name="employee" formControlName="employeeId">
                        <option [ngValue]="null"></option>
                        <option [ngValue]="employeeOption.id" *ngFor="let employeeOption of employees; trackBy: trackById">{{ employeeOption.id }}</option>
                    </select>
                </div>
            </div>

            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
                    <fa-icon icon="ban"></fa-icon>&nbsp;<span>Cancel</span>
                </button>

                <button type="submit" id="save-entity" [disabled]="editForm.invalid || isSaving" class="btn btn-primary">
                    <fa-icon icon="save"></fa-icon>&nbsp;<span>Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
